class Solution(object):
    def maximumBobPoints(self, numArrows, aliceArrows):
        max_score = 0
        best_bob = [0] * 12

        # 使用位掩码枚举所有可能的获胜区域组合
        for mask in range(1 << 12):
            arrows_used = 0
            score = 0
            bob = [0] * 12
            for k in range(12):
                if mask & (1 << k):
                    # Bob需要在这个区域赢，至少aliceArrows[k] + 1箭
                    bob[k] = aliceArrows[k] + 1
                    arrows_used += bob[k]
                    score += k
            if arrows_used > numArrows:
                continue
            if score > max_score:
                max_score = score
                # 处理剩余的箭，可以任意分配，但题目要求总和等于numArrows
                # 按照题意，剩余箭可以加到任意区域，不影响得分。通常加到0区域
                if arrows_used < numArrows:
                    remaining = numArrows - arrows_used
                    bob[0] += remaining
                best_bob = bob[:]
        return best_bob